package com.mx.zb.md.tenant.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.mx.zb.md.base.service.HelloService;

@RestController
public class CosumerService {
	
	@Autowired
	RestTemplate restTemplate;
	
	@Autowired
	HelloService helloService;
	
	@RequestMapping(value = "/ribbon-consumer", method = RequestMethod.GET)
	public String helloConsumer() {
		return restTemplate.getForEntity("http://miaodao-base/hello", String.class).getBody();
	}
	
	@RequestMapping(value = "/feign-consumer", method = RequestMethod.GET)
	public String helloConsumer2() {
		return helloService.hello("feign-consumer");
	}
}
